package com.lucky.auth_boot.controller;

import com.lucky.auth_boot.common.Result;
import com.lucky.auth_boot.pojo.dto.ChangePasswordDTO;
import com.lucky.auth_boot.pojo.dto.UserDTO;
import com.lucky.auth_boot.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/personal")
public class PersonalController {
    @Resource
    UserService userService;
    @PutMapping("/putChangePassword")
    public Result<?> putChangePassword(@RequestBody ChangePasswordDTO changePasswordDTO) {
        return Result.success(userService.putChangePassword(changePasswordDTO));
    }

    @PutMapping("/putPersonalInfo")
    public Result<?> putPersonalInfo(@RequestBody UserDTO userDTO) {
        return Result.success(userService.putPersonalInfo(userDTO));
    }
}